﻿@page
@using Microsoft.AspNetCore.Authentication
@using Microsoft.Extensions.Options
@inject IAuthenticationSchemeProvider SchemeProvider
@inject IOptionsMonitor<SimpleOptions> Options
@model IndexModel
@{
    ViewData["Title"] = "Home page";
}

<div class="row">
    <h2>Current Authentication Schemes</h2>
    <ul>
        @{
            var schemes = await SchemeProvider.GetAllSchemesAsync();
            foreach (var scheme in schemes)
            {
                <li><b>Scheme:</b> @scheme.Name -- <b>Handler:</b> @scheme.HandlerType.Name <b>DisplayMessage:</b> @Options.Get(scheme.Name).DisplayMessage <a asp-area="" asp-controller="Auth" asp-action="Remove" asp-route-scheme="@scheme.Name">Remove</a></li>
            }
        }
    </ul>
</div>
<div class="row">
    <h2>Add or update a scheme:</h2>
    <form asp-controller="Auth" asp-action="AddOrUpdate" method="post" class="form-horizontal" role="form">
        <div class="form-group">
            <label class="col-md-2 control-label">Scheme</label>
            <div class="col-md-10">
                <input type="text" name="scheme" />
            </div>
        </div>

        <div class="form-group">
            <label class="col-md-2 control-label">OptionsMessage</label>
            <div class="col-md-10">
                <input type="text" name="OptionsMessage" />
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="submit" class="btn btn-default">Add/Update</button>
            </div>
        </div>
    </form>
</div>
